package com.linghang.learnspringboot;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@MapperScan("com.linghang.learnspringboot.mapper")
@ComponentScan("com.linghang")
//注意：可更详细（但似乎也没必要），不要只写com,会扫描到第三方jar包，出错非常难排查
@SpringBootApplication
public class LearnspringbootApplication {

    public static void main(String[] args) {
        final Logger LOG = LoggerFactory.getLogger(LearnspringbootApplication.class);
        // SpringApplication.run(LearnspringbootApplication.class, args);
        SpringApplication app = new SpringApplication(LearnspringbootApplication.class);
        Environment environment = app.run(args).getEnvironment();
        LOG.info("启动成功");
        LOG.info("地址：\t http://127.0.0.1:{}", environment.getProperty("server.port"));

    }
}
